from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as _UserAdmin
from users.models import User


@admin.register(User)
class UserAdmin(_UserAdmin):
    # list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff','nickname')

    def __init__(self, *args, **kwargs):
        super(_UserAdmin,self).__init__(*args, **kwargs)
        self.list_display = self.list_display + ('nickname',)
        self.fieldsets[1][1]['fields'] +=('nickname',)
        self.add_fieldsets[0][1]['fields'] = (
            'username', 'nickname','email','password1', 'password2')
